package tech.eyao.hs60x.dao;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import tech.eyao.hs60x.common.CommonConstants;
import tech.eyao.hs60x.enums.Delete;
import tech.eyao.hs60x.manager.IdGenService;
import tech.eyao.hs60x.mapper.CallRecordsDOMapper;
import tech.eyao.hs60x.model.domain.CallRecordsDO;

/**
 * 类CallRecordDao.java的实现描述：通话记录
 * 
 * @author fengjianchao 2018年1月21日 下午7:52:46
 */
@Repository
public class CallRecordDao {
    //auto
    @Autowired
    private CallRecordsDOMapper callRecordDOMapper;

    /**
     * 添加通话记录
     * 
     * @param callRecordsDO
     * @return
     * @throws Exception
     */
    public boolean insertCallLog(CallRecordsDO callRecordsDO) throws Exception {
        callRecordsDO.setGmtCreated(new Date());
        callRecordsDO.setGmtModified(new Date());
        return callRecordDOMapper.insert(callRecordsDO) > 0;
    }

    /**
     * 获取手表端的通话记录
     * 
     * @param callRecordsDO
     * @return
     */
    public List<CallRecordsDO> queryCallLogListByConndition(CallRecordsDO callRecordsDO) {
        return callRecordDOMapper.queryCallLogListByConndition(callRecordsDO);
    }
}
